package com.wt.comtroller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RequestMapping("/consummer")
@RestController
public class ConsummerController {

    @Autowired
    private RestTemplate restTemplate;

    @GetMapping
    public String test(){
        System.out.println("------------消费者----------------");
        String forObject = restTemplate.getForObject("http://MYPROVIDER/provider", String.class);

        return forObject;
    }

}
